{% extends 'base/base.html' %}

{% block title %}
删除做菜指南
{% endblock %}

{% block main %}
<div class="row justify-content-center">
    <div class="col-md-6">
        <div class="card">
            <div class="card-header bg-danger text-white">
                <h3 class="mb-0">
                    <i class="fas fa-exclamation-triangle me-2"></i>
                    确认删除
                </h3>
            </div>
            <div class="card-body text-center">
                <div class="mb-4">
                    <i class="fas fa-utensils fa-4x text-danger mb-3"></i>
                    <h4>确定要删除这个做菜指南吗？</h4>
                </div>

                <div class="card bg-light">
                    <div class="card-body">
                        <h5 class="card-title">{{ recipe.name }}</h5>
                        <p class="card-text">{{ recipe.description|truncatewords:20 }}</p>
                        <div class="mb-2">
                            <span class="badge bg-primary me-1">{{ recipe.category.name }}</span>
                            <span class="badge bg-info me-1">{{ recipe.get_difficulty_display_cn }}</span>
                            <span class="badge bg-success">{{ recipe.get_total_cooking_time }}</span>
                        </div>
                        <small class="text-muted">
                            <i class="fas fa-user me-1"></i>
                            创建者: {{ recipe.created_by.username|default:"系统" }}
                            <i class="fas fa-calendar me-1 ms-3"></i>
                            创建时间: {{ recipe.created_at|date:"Y年m月d日" }}
                        </small>
                    </div>
                </div>

                <div class="alert alert-warning mt-4">
                    <i class="fas fa-warning me-2"></i>
                    <strong>警告：</strong>此操作不可撤销！删除后将无法恢复这个做菜指南及其相关的食材和步骤信息。
                </div>

                <form method="post">
                    {% csrf_token %}
                    <div class="d-grid gap-2 d-md-flex justify-content-md-center">
                        <a href="{% url 'main:recipe_detail' recipe.id %}" class="btn btn-secondary me-md-2">取消</a>
                        <button type="submit" class="btn btn-danger">
                            <i class="fas fa-trash me-1"></i>确认删除
                        </button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{% endblock %}

